package org.huatek.anders.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import org.huatek.anders.constant.RabbitConstant;
import org.huatek.anders.entity.MqMessageEntity;
import org.huatek.anders.service.SenderTipsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author anders
 * @date 2018-11-19 16:11
 * 发送消息通知
 **/
@RestController
public class SendTipsController {
    @Reference
    SenderTipsService senderTipsService;

    @GetMapping("/send/message")
    public void sendObject(){
        MqMessageEntity mqMessageEntity = new MqMessageEntity();
        mqMessageEntity.setContent("这是一个通知消息");
        mqMessageEntity.setRoutingKey(RabbitConstant.QUEUE_TIPS);
        senderTipsService.send(mqMessageEntity);
    }
}
